<template>
	<view class="yz" :class="{'theme--Black':CurrentTheme.name==='DarkMode'}">
		<view class="listitem mt20 borBot" @click="$pub.naviTo('/pages/other/Setting/myInfoSet/index')">
			<view class="flex align-center">
				<text class="cuIcon-people fo-50 mr40"></text>
				<text class="fo-30">个人信息</text>
			</view>
			<text class="cuIcon-right fo-gray fo-32"></text>
		</view>
		<view class="listitem" @click="$pub.naviTo('/pages/other/accountCheck/index')">
			<view class="flex align-center">
				<text class="cuIcon-friend fo-50 mr40"></text>
				<text class="fo-30">账号管理</text>
			</view>
			<text class="cuIcon-right fo-gray fo-32"></text>
		</view>
		<!-- <view class="listitem mt20 borTop">
			<view class="flex align-center">
				<text class="cuIcon-mobile fo-50 mr40"></text>
				<text class="fo-30">设备管理</text>
			</view>
			<text class="cuIcon-right fo-gray fo-32"></text>
		</view>
		<view class="listitem mt20 borTop">
			<view class="flex align-center">
				<text class="cuIcon-lightauto fo-50 mr40"></text>
				<text class="fo-30">自动备份设置</text>
			</view>
			<text class="cuIcon-right fo-gray fo-32"></text>
		</view>
		<view class="listitem">
			<view class="flex align-center">
				<text class="cuIcon-wifi fo-50 mr40"></text>
				<text class="fo-30">网络设置</text>
			</view>
			<text class="cuIcon-right fo-gray fo-32"></text>
		</view>
		<view class="listitem">
			<view class="flex align-center">
				<text class="cuIcon-people fo-50 mr40"></text>
				<text class="fo-30">默认下载位置</text>
			</view>
			<text class="cuIcon-right fo-gray fo-32"></text>
		</view>
		<view class="listitem">
			<view class="flex align-center">
				<text class="cuIcon-people fo-50 mr40"></text>
				<text class="fo-30">洋盘锁屏码</text>
			</view>
			<text class="cuIcon-right fo-gray fo-32"></text>
		</view>
		<view class="listitem mt20 borTop">
			<view class="flex align-center">
				<text class="cuIcon-file fo-50 mr40"></text>
				<text class="fo-30">文件夹设置</text>
			</view>
			<text class="cuIcon-right fo-gray fo-32"></text>
		</view>
		<view class="listitem">
			<view class="flex align-center">
				<text class="cuIcon-notice fo-50 mr40"></text>
				<text class="fo-30">消息提醒设置</text>
			</view>
			<text class="cuIcon-right fo-gray fo-32"></text>
		</view>
		<view class="listitem">
			<view class="flex align-center">
				<text class="cuIcon-people fo-50 mr40"></text>
				<text class="fo-30">闪电互传设置</text>
			</view>
			<text class="cuIcon-right fo-gray fo-32"></text>
		</view>
		<view class="listitem">
			<view class="flex align-center">
				<text class="cuIcon-people fo-50 mr40"></text>
				<text class="fo-30">隐私设置</text>
			</view>
			<text class="cuIcon-right fo-gray fo-32"></text>
		</view>
		<view class="listitem">
			<view class="flex align-center">
				<text class="cuIcon-people fo-50 mr40"></text>
				<text class="fo-30">二级密码设置</text>
			</view>
			<text class="cuIcon-right fo-gray fo-32"></text>
		</view>
		<view class="listitem">
			<view class="flex align-center">
				<text class="cuIcon-people fo-50 mr40"></text>
				<text class="fo-30">高级设置</text>
			</view>
			<text class="cuIcon-right fo-gray fo-32"></text>
		</view> -->
		
		
		<view class="listitem mt20 borBot" @click="onLocalStorageManager">
			<view class="flex align-center">
				<text class="cuIcon-safe fo-50 mr40"></text>
				<text class="fo-30">存储空间管理</text>
			</view>
			<view class="flex align-center">
				<text class="mr20 fo-gray">清理缓存</text>
				<text class="cuIcon-right fo-gray fo-32"></text>
			</view>
		</view>
		
		<view class="listitem borBot">
			<view class="flex align-center">
				<text class="cuIcon-info fo-50 mr40"></text>
				<text class="fo-30">关于洋盘</text>
			</view>
			<text class="cuIcon-right fo-gray fo-32"></text>
		</view>
		<view class="listitem borBot" @click="$pub.naviTo('/pages/other/Setting/historyUpdate')">
			<view class="flex align-center">
				<text class="cuIcon-time fo-50 mr40"></text>
				<text class="fo-30">查看历史更新</text>
			</view>
			<text class="cuIcon-right fo-gray fo-32"></text>
		</view>
		
		<view class="listitem " @click="CheckUpdateVersion">
			<view class="flex align-center">
				<text class="cuIcon-vip fo-50 mr40"></text>
				<text class="fo-30">检查新版本</text>
			</view>
			<view class="flex align-center">
				<text class="mr20 fo-gray">{{ Version }}</text>
				<text class="cuIcon-right fo-gray fo-32"></text>
			</view>
		</view>
		
	</view>
</template>

<script>
import { CheckUpdate } from '../../../common/API/index.js';
import checkUpdate from '../../../common/components/update/yang-update.js';
export default {
	name: '',
	data() {
		return {
			Version: ''
		};
	},
	onLoad() {
		// #ifdef APP-PLUS
		plus.runtime.getProperty(plus.runtime.appid, async widgetInfo => {
			this.Version = widgetInfo.version;
		});
		// #endif
	},
	methods: {
		// 检查版本更新
		async CheckUpdateVersion() {
			// #ifdef APP-PLUS
			let { code, data } = await CheckUpdate({ Os: plus.os.name });
			console.log('CheckUpdate接口：', code, data);
			if (code === 200) {
				plus.runtime.getProperty(plus.runtime.appid, async widgetInfo => {
					let n = data.Version.split('.').map(i => (i = Number(i)));
					let o = widgetInfo.version.split('.').map(i => (i = Number(i)));
					console.log('新版本', data.Version);
					console.log('本地版本', widgetInfo.version);
					let fn = () => {
						if (n[0] > o[0]) {
							checkUpdate();
							return;
						}
						if (n[0] == o[0] && n[1] > o[1]) {
							checkUpdate();
							return;
						}
						if (n[0] == o[0] && n[1] == o[1] && n[2] > o[2]) {
							checkUpdate();
							return;
						}
						this.$pub.Toast('当前已是最新版本！');
					};
					fn();
				});
			}
			// #endif
		},
		// 跳转缓存管理界面
		onLocalStorageManager(){
			this.$pub.naviTo('/pages/other/StorageManager/index')
		}
	}
};
</script>

<style lang="less">
.yz{
	background-color: rgba(249,249,249,1);
	height: calc(100vh - 50px);
	overflow: scroll;
}
.listitem {
	background-color: #fff;
	padding: 20rpx;
}
.borBot {
	border-bottom: 1px solid #ededed;
}
</style>
